import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '项目名称',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '项目编号',
    align:"center",
    dataIndex: 'code'
   },
   {
    title: '简介',
    align:"center",
    dataIndex: 'introduction'
   },
   {
    title: '地址',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '经纬度',
    align:"center",
    dataIndex: 'latLong'
   },
   {
    title: '省市区',
    align:"center",
    dataIndex: 'regions',
    slots: { customRender: 'pcaSlot' },
   },
   {
    title: '省市区名称',
    align:"center",
    dataIndex: 'regionsName'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'note'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '项目名称',
    field: 'name',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入项目名称!'},
          ];
     },
  },
  {
    label: '项目编号',
    field: 'code',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入项目编号!'},
          ];
     },
  },
  {
    label: '简介',
    field: 'introduction',
    component: 'InputTextArea',
  },
  {
    label: '地址',
    field: 'address',
    component: 'InputTextArea',
  },
  {
    label: '经纬度',
    field: 'latLong',
    component: 'Input',
  },
  {
    label: '省市区',
    field: 'regions',
    component: 'JAreaLinkage',
  },
  {
    label: '省市区名称',
    field: 'regionsName',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'note',
    component: 'InputTextArea',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}